const Sequelize = require('sequelize');
const DB = require("../config/dbconfig");

const commentRelationModel = DB.define('comment_rela_tab', {
    comment_rela_id: {
      type: Sequelize.INTEGER,
      allowNull: false,
      primaryKey: true,
      comment: "评论关系id，主键"
    },
    comment_id: {
      type: Sequelize.INTEGER,
      allowNull: true
    },
    content: {
      type: Sequelize.STRING(255),
      allowNull: true
    },
    parent_id: {
      type: Sequelize.INTEGER,
      allowNull: true
    },
    is_delete:{
      type:Sequelize.INTEGER(2),
      comment:"是否删除"
    }
  }, {
    Sequelize,
    tableName: 'comment_rela_tab',
    timestamps: false,
    indexes: [
      {
        name: "PRIMARY",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "comment_rela_id" },
        ]
      },
      {
        name: "comment_id",
        using: "BTREE",
        fields: [
          { name: "comment_id" },
        ]
      },
    ]
  });
module.exports = commentRelationModel
